<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>家长管理</title>
    <meta name="context-path" th:content="@{/}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/bootstrap.min.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/bootstrap-responsive.min.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-style.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-media.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-full.css}"/>
    <link rel="stylesheet" th:href="@{/resources/jquery-easyui/themes/metro/easyui.css}" />
    <link rel="stylesheet" th:href="@{/resources/matrix/font-awesome/css/font-awesome.css}"/>
    <link rel="stylesheet" th:href="@{/resources/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/resources/css/website.css}"/>
</head>
<body class="childbody">
<div class="container-fluid">
    <!--Chart-box-->
    <div class="row-fluid">
        <div class="widget-box">
            <div class="widget-title bg_lg"><span class="icon"><i class="icon-search"></i></span>
                <h5>查询</h5>
            </div>
            <div class="widget-content nopadding">
                <form id="queryform" action="#" method="get" class="form-horizontal query-form">
                    <div class="row-fluid query-row">
                        <div class="span3">
                            <div class="control-group">
                                <label class="control-label query-control-label">用户名</label>
                                <div class="controls query-controls">
                                    <input type="text" id="userName" name="userName" class="span11" placeholder="请输入用户名">
                                </div>
                            </div>
                        </div>
                        <div class="span3">
                            <div class="control-group">
                                <label class="control-label query-control-label">真实姓名</label>
                                <div class="controls query-controls">
                                    <input type="text" id="realName" name="realName" class="span11" placeholder="请输入真实姓名">
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--<div class="row-fluid query-row">
                        <div class="span3">
                            <div class="control-group">
                                <label class="control-label">行政区划：</label>
                                <div class="controls form-group">
                                    <select class="span6 form-control" id="county" name="orgId">
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>-->
                    <div class="form-actions">
                        <button id="btnSearch" type="button" class="btn btn-primary">查询</button>
                        <button id="btnResetSearch" type="button" class="btn btn-info">重置</button>

                    </div>
                </form>
            </div>
        </div>
        <!--End-Chart-box-->
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box">
                    <div class="widget-title"><span class="icon"> <i class="icon-th"></i> </span>
                        <h5>数据</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <div class="table_actions">
                            <button id="btnAdd"  type="button"  class="btn btn-primary">添加</button>
                            <button id="btnEdit"  type="button"  class="btn btn-info">修改</button>
                            <button id="btnDelete"  type="button"  class="btn btn-danger">删除</button>
                            <!--<button id="btnReset"  type="button"  class="btn btn-danger">密码重置</button>
                            <button id="btnExport" type="button" class="btn btn-primary">导出</button>-->
                            <button id="btnExport" type="button" class="btn btn-primary">导出</button>
                            <button id="btnImport"  type="button"  class="btn btn-success">导入</button>
                            <button id="btnMessage"  type="button"  class="btn btn-primary">查看聊天记录</button>
                        </div>
                        <table id="tablelist" class="layui-table">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/resources/js/jquery.min.js}"></script>
<script th:src="@{/resources/js/jquery-migrate-1.2.1.js}"></script>
<script th:src="@{/resources/jquery-easyui/jquery.easyui.min.js}"></script>
<script th:src="@{/resources/layui/layui.all.js}" charset="utf-8"></script>
<script th:src="@{/resources/valid/js/bootstrapValidator.js}"></script>
<script th:src="@{/resources/valid/js/language/zh_CN.js}"></script>
<script th:src="@{/resources/js/website.js}"></script>
<script th:src="@{/resources/js/system.js}"></script>
<script th:src="@{/resources/js/validation_fields.js}"></script>
<script th:inline="javascript">
    /*<![CDATA[*/
    $(document).keyup(function (event) {
        if (event.keyCode == 13) {
            search();
        }
    });
    /*]]>*/
</script>

<script th:inline="javascript">
    /*<![CDATA[*/
    var query, add, edit, del,addUsers,reset,exports,importExcel,viewMessage;
    layui.use(['jquery', 'layer', 'laydate'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            table = layui.table;

        lay('.date').each(function () {
            laydate.render({
                elem: this
            });
        });

        var cols = [
            [
                {type: 'checkbox'},
                {field: 'userName', width: '20%', title: '用户名', sort: true},
                {field: 'realName', width: '20%', title: '真实姓名', sort: true},
                {field: 'phoneNumber', width: '15%', title: '手机号码', sort: true},
                {field: 'lastLoginTime', width: '15%', title: '最后登录时间', sort: true},
                {field: 'description', title: '描述', sort: true},
            ]
        ];

        query = new ListQuery(table, {
            cols: cols,
            element: "#tablelist",
            url: contextRoot + "schoolStudentParent/doListParent",
            page: 1,
            tableid: "user_list_table",
            extraData: function () {
                return $("#queryform").serializeObject();
            }
        })
        query.reload();

        viewMessage = new ListEdit(layer, {
            title: "查看聊天记录",
            url: contextRoot + "schoolStudentParent/getMessageList",
            width: "1100px",
            isfull: true,
            height: "600px"
        }, query);

        add = new ListAdd(layer, {
            title: "添加家长",
            url: contextRoot + "schoolStudentParent/getAddParent",
            width: "1200px",
            height: "700px"
        }, query);

        edit = new ListEdit(layer, {
            title: "修改家长",
            url: contextRoot + "schoolStudentParent/getEditParent",
            width: "1200px",
            height: "700px"
        }, query);

        del = new ListDelete(layer, query, {
            url: contextRoot + "schoolStudentParent/doDeleteParent"
        });

        reset = new ListRelease(layer, query, {
            url: contextRoot + "schoolStudentParent/doReset",
            msg: "确认重置该用户密码吗？"
        });

        exports = new ListExport(layer, {
            url: contextRoot + "schoolStudentParent/exportParentLists",
            confirmText : "是否导出数据",
            extraData: function () {
                return $("#queryform").serializeObject();
            }

        });


        importExcel = new ListAdd(layer, {
            title: "导入学生",
            url: contextRoot + "schoolStudentParent/goFileUpload",
            width: "860px",
            height: "350px"
        }, query);

        $("#btnExport").bind("click", function (event) {
            exports.export();
        });

        $("#btnImport").bind("click", function (event) {
            importExcel.openDialog();
        });

        $("#btnResetSearch").bind("click", function (event) {
            $("#realName").val("");
            $("#name").val("");
        });

        $("#btnAdd").bind("click", function (event) {
            add.openDialog();
        });

        $("#btnSearch").bind("click", function (event) {
            query.reload();
        });

        $("#btnEdit").bind("click", function (event) {
            edit.openDialog();
        });

        $("#btnMessage").bind("click", function (event) {
            viewMessage.openDialog();
        });

        $("#btnDelete").bind("click", function (event) {
            del.submit();
        });
        $("#btnReset").bind("click", function (event) {
            reset.submit();
        });

    });

    /*]]>*/
</script>
</body>
</html>